﻿using System;

namespace JuCheap.Core.Infrastructure.Utilities
{

    /// <summary>
    /// 当前登陆用户信息
    /// </summary>
    public class CurrentUserDto
    {
        /// <summary>
        /// 登陆用户Id
        /// </summary>
        public string UserId { get; set; }

        /// <summary>
        /// 登陆账号
        /// </summary>
        public string LoginName { get; set; }

        /// <summary>
        /// 姓名
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 登陆用户所属公司Id
        /// </summary>
        public string CompanyId { get; set; }

        /// <summary>
        /// 登陆用户所属公司名称
        /// </summary>
        public string CompanyName { get; set; }

        /// <summary>
        /// 是否是管理员
        /// </summary>
        public bool IsAdmin { get; set; }

        /// <summary>
        /// 是否是系统公司
        /// </summary>
        public bool IsSystemCompany { get; set; }
    }

    /// <summary>
    /// 全局用户获取接口(获取当前登陆用户的公司Id，需要使用者自己去实现这个接口)
    /// </summary>
    public interface ICurrentUserService
    {
        /// <summary>
        /// 获取公司Id
        /// </summary>
        /// <returns></returns>
        string GetCompanyId();

        /// <summary>
        /// 获取当前登陆用户的Id
        /// </summary>
        /// <returns></returns>
        string GetUserId();

        /// <summary>
        /// 是否是管理员
        /// </summary>
        /// <returns></returns>
        bool IsAdmin();

        /// <summary>
        /// 获取当前登陆用户的Id
        /// </summary>
        /// <returns></returns>
        bool IsSystemCompany();

        /// <summary>
        /// 获取当前登陆用户
        /// </summary>
        /// <returns></returns>
        CurrentUserDto GetCurrentUser();
    }
}
